package com.crm.CLdriving.config;


import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
/**
 * 添加拦截器到spring容器中
 * @author Administrator
 *
 */
//@Configuration
public class AddLoginInterceptor implements WebMvcConfigurer {
	
	@Override
    public void addInterceptors(InterceptorRegistry registry){
		//addPathPatterns("/**")拦截所以路径 ，
		//.excludePathPatterns("/driving/login");除外
        registry.addInterceptor(new LoginInterceptor()).addPathPatterns("/**")
        .excludePathPatterns("/login/select","/mail/sendMail","/static/**")
        .excludePathPatterns("/swagger-resources/**", "/webjars/**", "/v2/**", "/swagger-ui.html/**");
    }
	
}
